const TOKEN_KEY = 'MM_token'

const setToken = (token) => {
  localStorage.setItem(TOKEN_KEY, JSON.stringify(token))
}

const removeToken = () => {
  localStorage.removeItem(TOKEN_KEY)
}

const getToken = () => {
  const data = localStorage.getItem(TOKEN_KEY)
  return JSON.parse(data)
}

export { setToken, getToken, removeToken }
